<!DOCTYPE html>

<html>
<head>
  <style>
    .box {
      position: relative;
      width: 100px;
      height: 100px;
      border: 1px solid black;
    }
    
    .middle {
      visibility: hidden;
    }

    .inner {
      width: 80px;
      height: 80px;
      animation: spin 5s linear infinite;
    }

    @keyframes spin {
      0% { transform: rotate(0); }
      100% { transform: rotate(360deg); }
    }
    
    #transition-tester {
      position: relative;
      left: 0;
      background-color: blue;
      transition: left 1s linear;
    }
    
    #container.animating #transition-tester {
      left: 20px;
    }
    
  </style>
  <script src="../../animations/resources/animation-test-helpers.js"></script>
  <script>
    const expectedValues = [
      // [time, element-id, property, expected-value, tolerance]
      [0.5, 'transition-tester', 'left', 10, 2],
    ];

    function setupTest()
    {
      document.getElementById('container').className = 'animating';
    }

    runTransitionTest(expectedValues, setupTest);
  </script>
</head>
<body>

<p>Tests that starting an animation on an element inside a visibility:hidden element does not block later transitions.</p>
  <div id="container" class="container">
    <div id="transition-tester" class="box"></div>

    <div class="middle box">
      <div class="inner box"></div>
    </div>
  </div>

<div id="result"></div>

</body>
</html>
